﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.ServiceModel;
using System.Text;

namespace ClientTest
{
    class Program
    {
        static void Main(string[] args)
        {
            string url = "uri|net.tcp://localhost:10001/MessageService,contract|TestService.Contract.MessageService";
            ChannelFactory<TestService.Contract.IMessageService> channelFactory = WCFClient.ConnectChannelFacotoryByURLStr<TestService.Contract.IMessageService>(url);
            TestService.Contract.IMessageService dao = channelFactory.CreateChannel();
            TestService.Contract.Data.MessageModel model = new TestService.Contract.Data.MessageModel
            {
                MessageId = Guid.NewGuid().ToString(),
                Content = "测试发送消息",
                CreateTime = DateTime.Now
            };
            var result = dao.Send(model);


            Console.WriteLine("操作结果：" + result.ToString());
            Console.ReadKey();
        }
    }
}
